<div
    bsModal
    #actionModal="bs-modal"
    class="modal fade"
    tabindex="-1"
    role="dialog"
    aria-labelledby="actionModal"
    aria-hidden="true"
    [config]="{ backdrop: 'static' }"
>
    <div class="modal-dialog">
        <div class="modal-content">
            <form
                *ngIf="active"
                #editForm="ngForm"
                novalidate
                (ngSubmit)="save()"
            >
                <div class="modal-header">
                    <h4 class="modal-title">
                        <span>新建工序工时</span>
                    </h4>
                    <button
                        type="button"
                        class="close"
                        (click)="close()"
                        aria-label="Close"
                    >
                        <span aria-hidden="true">&times;</span>
                    </button>
                </div>

                <div class="modal-body">
                    <div
                        class="form-group form-md-line-input form-md-floating-label no-hint"
                    >
                        <label
                            >任务号
                            <span class="text-danger">*</span>
                        </label>
                        <input
                            class="form-control"
                            name="taskCode"
                            type="text"
                            [ngClass]="{ edited: proc.taskCode }"
                            [(ngModel)]="proc.taskCode"
                            required
                        />
                    </div>
                    <div
                        class="form-group form-md-line-input form-md-floating-label no-hint"
                    >
                        <label
                            >任务名称
                            <span class="text-danger">*</span>
                        </label>
                        <input
                            class="form-control"
                            name="taskName"
                            type="text"
                            [ngClass]="{ edited: proc.taskName }"
                            [(ngModel)]="proc.taskName"
                            required
                        />
                    </div>
                    <div
                        class="form-group form-md-line-input form-md-floating-label no-hint"
                    >
                        <label
                            >图号
                            <span class="text-danger">*</span>
                        </label>
                        <input
                            class="form-control"
                            name="drawingNum"
                            type="text"
                            [ngClass]="{ edited: proc.drawingNum }"
                            [(ngModel)]="proc.drawingNum"
                            required
                        />
                    </div>
                    <div
                        class="form-group form-md-line-input form-md-floating-label no-hint"
                    >
                        <label
                            >投产数量
                            <span class="text-danger">*</span>
                        </label>
                        <input
                            class="form-control"
                            name="amount"
                            type="number"
                            min="1"
                            [ngClass]="{ edited: proc.amount }"
                            [(ngModel)]="proc.amount"
                            required
                        />
                    </div>
                    <div
                        class="form-group form-md-line-input form-md-floating-label no-hint"
                    >
                        <label
                            >主制班组 <span class="text-danger">*</span>
                        </label>
                        <br />
                        <p-dropdown
                            [style]="{
                                width: '90%'
                            }"
                            [options]="teamGroups"
                            name="teamGroups"
                            [(ngModel)]="teamGroupName"
                            placeholder="选择班组"
                            optionLabel="displayText"
                        ></p-dropdown>
                        <!-- <input class="form-control" name="orgName" type="text" [ngClass]="{'edited': proc.orgName}" [(ngModel)]="proc.orgName" required> -->
                    </div>
                    <div
                        class="form-group form-md-line-input form-md-floating-label no-hint"
                    >
                        <label
                            >质控卡
                            <span class="text-danger">*</span>
                        </label>
                        <input
                            class="form-control"
                            name="zhiKongKaCode"
                            type="text"
                            [ngClass]="{ edited: proc.zhiKongKaCode }"
                            [(ngModel)]="proc.zhiKongKaCode"
                            required
                        />
                    </div>
                    <div
                        class="form-group form-md-line-input form-md-floating-label no-hint"
                    >
                        <label
                            >工序名称
                            <span class="text-danger">*</span>
                        </label>
                        <input
                            class="form-control"
                            name="nodeName1"
                            type="text"
                            [ngClass]="{ edited: proc.nodeName }"
                            [(ngModel)]="proc.nodeName"
                            required
                        />
                    </div>
                    <div *ngIf="proc.id == null"
                        class="form-group form-md-line-input form-md-floating-label no-hint"
                    >
                        <label
                            >总定额
                            <span class="text-danger">*</span>
                        </label>
                        <input
                            class="form-control"
                            name="totalQuotaWorkingTime"
                            type="number"
                            min="0"
                            [ngClass]="{ edited: proc.totalQuotaWorkingTime }"
                            [(ngModel)]="proc.totalQuotaWorkingTime"
                            required
                        />
                    </div>
                    <div
                        class="form-group form-md-line-input form-md-floating-label no-hint"
                    >
                        <label
                            >工序工时
                            <span class="text-danger">*</span>
                        </label>
                        <input
                            class="form-control"
                            name="totalProcWorkingTime"
                            type="number"
                            min="0"
                            [ngClass]="{ edited: proc.totalProcWorkingTime }"
                            [(ngModel)]="proc.totalProcWorkingTime"
                            required
                        />
                    </div>
                </div>

                <div class="modal-footer">
                    <button
                        [disabled]="saving"
                        type="button"
                        class="btn btn-default"
                        (click)="close()"
                    >
                        {{ l('Cancel') }}
                    </button>
                    <button
                        type="submit"
                        class="btn btn-primary blue"
                        [disabled]="!editForm.form.valid"
                        [buttonBusy]="saving"
                        [busyText]="'保存中...'"
                    >
                        <i class="fa fa-check-circle"></i>
                        <span>保存</span>
                    </button>
                </div>
            </form>
        </div>
    </div>
</div>
